package com.scse.bms.mapper;

import com.scse.bms.entity.HistoryDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;


/**
 * @Title: HistoryMapper
 * @Author: 吴赠禹
 * @Date: 2021/2/24 7:15
 * @Version: 1.0
 * @Description: TODO
 */

@Mapper
@Repository
public interface HistoryMapper {

    /**
     * 插入浏览历史
     * @param history
     * @return
     */
    @Insert("insert into t_history(user_id, book_id, theme_id) values(#{userId}, #{bookId}, #{themeId})")
    int insert(HistoryDO history);


    /**
     * 记录浏览历史
     * @param userId
     * @param bookId
     * @param themeId
     * @return
     */
    @Insert("insert into t_history(user_id, book_id, theme_id) values(#{userId}, #{bookId}, #{themeId})")
    int insert(@Param("userId") Integer userId, @Param("bookId") Integer bookId, @Param("themeId") Integer themeId);
}
